import { db } from './connect'

db.exec(`
    create table if not exists logs (
        id integer primary key autoincrement not null,
        date text not null,
        content text not null,
        created_at text not null
    )
    `)

db.exec(`
    create table if not exists projs (
        id integer primary key autoincrement not null,
        company text not null,
        name text not null,
        shortName text not null,
        dianya text not null,
        created_at text not null
    )
    `)

db.exec(`
    create table if not exists comps (
        id integer primary key autoincrement not null,
        name text not null,
        shortName text not null,
        fr text not null,
        sjfzr text not null,
        created_at text not null
    )
    `)

db.exec(`
    create table if not exists teams (
        id integer primary key autoincrement not null,
        name text not null,
        fzr text not null,
        compId integer not null,
        evaluate integer not null,
        created_at text not null
    )
    `)

db.exec(`
    create table if not exists records (
        id integer primary key autoincrement not null,
        projId integer not null,
        compId integer not null,
        teamId integer not null,
        date string not null,
        created_at text not null
    )
    `)

db.exec(`
    create table if not exists keypersons (
        id integer primary key autoincrement not null,
        gongxu string not null,
        compId integer not null,
        name integer not null,
        zhiwu string not null,
        iCard string,
        remark string,
        created_at text not null
    )
    `)

// for (let index = 0; index < 10; index++) {
//   const date = Random.date()
//   const content = Random.cparagraph()
//   db.exec(`
//           insert into logs (date,content,created_at) values ('${date}','${content}',datetime());
//           `)
// }
